package logic.ships.autoWeaponShip;

import fileHandling.language.properties.NodeProps;
import logic.nodes.nodeSettings.upgrades.UpgradableSettings;
import logic.ships.moveableShip.MovableShipProperties;

public class AutoWeaponShipProperties extends MovableShipProperties {
	
	public AutoWeaponShipProperties(UpgradableSettings settings) {
		super(settings);
	}
	
	public float getEnergyRange() { return Float.valueOf(getValueOf(NodeProps.Energy_Range)).floatValue(); }
	
	public float getHeatSeekerRange() { return Float.valueOf(getValueOf(NodeProps.HeatSeeker_Range)).floatValue(); }
	
	public float getMissileRange() { return Float.valueOf(getValueOf(NodeProps.Missile_Range)).floatValue(); }
	
	public float getMinWeaponRange() {
		float energyRange = getEnergyRange();
		float heatSeekerRange = getHeatSeekerRange();
		float missileRange = getMissileRange();
		if(energyRange < heatSeekerRange && energyRange < missileRange) return energyRange;
		if(heatSeekerRange < energyRange && heatSeekerRange < missileRange) return heatSeekerRange;
		return missileRange;
	}
	
	public float getMaxWeaponRange() {
		float energyRange = getEnergyRange();
		float heatSeekerRange = getHeatSeekerRange();
		float missileRange = getMissileRange();
		if(energyRange > heatSeekerRange && energyRange > missileRange) return energyRange;
		if(heatSeekerRange > energyRange && heatSeekerRange > missileRange) return heatSeekerRange;
		return missileRange;
	}
}